From 3e8ad22aa8b2496b4a0d20382590c9bac89844b4 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 14 Jul 2006 10:31:36 +0100 Subject: [PATCH] [powerpc] support additional interrupt controller types in xen/arch/x86/irq.c PowerPC #includes xen/arch/x86/irq.c, so we need to support MPIC interrupt controllers here. From: Hollis Blanchard Signed-off-by: Keir Fraser --- xen/arch/x86/irq.c | 15 +++++++++++---- xen/include/xen/irq.h | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index b12c2f5ba0..a14011d650 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -387,10 +387,6 @@ int pirq_acktype(int irq) if ( !strcmp(desc->handler->typename, "IO-APIC-edge") ) return ACKTYPE_NONE; - /* Legacy PIC interrupts can be acknowledged from any CPU. */ - if ( !strcmp(desc->handler->typename, "XT-PIC") ) - return ACKTYPE_UNMASK; - /* * Level-triggered IO-APIC interrupts need to be acknowledged on the CPU * on which they were received. This is because we tickle the LAPIC to EOI. @@ -398,6 +394,17 @@ int pirq_acktype(int irq) if ( !strcmp(desc->handler->typename, "IO-APIC-level") ) return ioapic_ack_new ? ACKTYPE_EOI : ACKTYPE_UNMASK; + /* Legacy PIC interrupts can be acknowledged from any CPU. */ + if ( !strcmp(desc->handler->typename, "XT-PIC") ) + return ACKTYPE_UNMASK; + + if ( strstr(desc->handler->typename, "MPIC") ) + { + if ( desc->status & IRQ_LEVEL ) + return (desc->status & IRQ_PER_CPU) ? ACKTYPE_EOI : ACKTYPE_UNMASK; + return ACKTYPE_NONE; /* edge-triggered => no final EOI */ + } + BUG(); return 0; } diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h index b3f8f9d548..f1c1ef4a7c 100644 --- a/xen/include/xen/irq.h +++ b/xen/include/xen/irq.h @@ -22,6 +22,7 @@ struct irqaction #define IRQ_PENDING 4 /* IRQ pending - replay on enable */ #define IRQ_REPLAY 8 /* IRQ has been replayed but not acked yet */ #define IRQ_GUEST 16 /* IRQ is handled by guest OS(es) */ +#define IRQ_LEVEL 64 /* IRQ level triggered */ #define IRQ_PER_CPU 256 /* IRQ is per CPU */ /* -- 2.30.2